gtk-demo: Fix the size saving for CSD
authorMatthias Clasen <mclasen@redhat.com>
Sun, 14 Feb 2016 14:29:55 +0000 (09:29 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 14 Feb 2016 15:56:26 +0000 (10:56 -0500)
We need to use gtk_window_get_size to get the correct size that
we can pass to gtk_window_set_default_size regardless of CSD
or not.

demos/gtk-demo/application.c

index 195eb611f0ca9c7a8a1341d0e54cd905c78aaf29..c85102d46c28abadec0660b99515f63228a43938 100644 (file)
@@ -487,10 +487,7 @@ demo_application_window_size_allocate (GtkWidget     *widget,
   GTK_WIDGET_CLASS (demo_application_window_parent_class)->size_allocate (widget, allocation);
 
   if (!window->maximized && !window->fullscreen)
-    {
-      window->width = allocation->width;
-      window->height = allocation->height;
-    }
+    gtk_window_get_size (GTK_WINDOW (window), &window->width, &window->height);
 }
 
 static gboolean